package com.example.room.dao;

import com.example.room.entity.Master;

import java.util.List;

import androidx.lifecycle.LiveData;
import androidx.room.Dao;
import androidx.room.Delete;
import androidx.room.Insert;
import androidx.room.Query;
import androidx.room.Update;

/**
 * author: WangJunYan
 * package: com.example.wjy.room
 * date: 2020/6/19
 * time: 16:38
 * room的组件之一，用于通过room直接与本地数据库交互
 */
@Dao
public interface MasterDao {
    @Query("SELECT * FROM Master")
    LiveData<List<Master>> getAllMaster();

    @Insert
    void insertMaster(Master... master);

    @Query("delete from Master")
    void deleteAllMaster();
}
